<?php
if($_POST){
    $dir="images/";
    $img_name=$_FILES['img']['name'];
    if(move_uploaded_file($_FILES['img']['tmp_name'],$dir.$img_name)){
        echo "uploaded";
    }
}
?>